home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_480 / tpledit / src / x.tpl.c < prev   
C/C++ Source or Header  |  1992-05-06  |  4KB  |  161 lines

  1.  
  2. /*
  3.  * x.tpl.c
  4.  *
  5.  * MACHINE GENERATED
  6.  */
  7.  
  8. #ifndef NO_GAD_HEADERS
  9. #include <exec/types.h>
  10. #include <exec/lists.h>
  11. #include <intuition/intuition.h>
  12. #include <intuition/screens.h>
  13. #include <intuition/gadgetclass.h>
  14. #include <libraries/gadtools.h>
  15. #include <clib/gadtools_protos.h>
  16. #endif
  17.  
  18. #define NG_B3 (NGAry + 0)
  19. #define NG_B4 (NGAry + 1)
  20. #define NG_r1 (NGAry + 2)
  21. #define NG_S1 (NGAry + 3)
  22. #define NG_B1 (NGAry + 4)
  23. #define NG_B2 (NGAry + 5)
  24. #define GAD_B3 0
  25. #define GAD_B4 1
  26. #define GAD_r1 2
  27. #define GAD_S1 3
  28. #define GAD_B1 4
  29. #define GAD_B2 5
  30.  
  31. struct NewGadget NGAry[6] = {
  32.     { 42,107,145,15,"L3",(void *)0L,GAD_B3,0x0000,(void *)0L },
  33.     { 41,152,146,14,"L4",(void *)0L,GAD_B4,0x0000,(void *)0L },
  34.     { 72,182,83,16,"hello",(void *)0L,GAD_r1,0x0008,(void *)0L },
  35.     { 42,23,127,61,"SEL",(void *)0L,GAD_S1,0x0008,(void *)0L },
  36.     { 31,221,55,40,"BUT1",(void *)0L,GAD_B1,0x0010,(void *)0L },
  37.     { 117,221,62,40,"BUT2",(void *)0L,GAD_B2,0x0010,(void *)0L }
  38. };
  39.  
  40. #define WIN_LEFT   0
  41. #define WIN_TOP    186
  42. #define WIN_WIDTH  228
  43. #define WIN_HEIGHT 289
  44.  
  45. struct Gadget *Gad_B3;
  46. char *Buf_B3;
  47. char *DefText_B3 = "D3";
  48. struct Gadget *Gad_B4;
  49. char *Buf_B4;
  50. char *DefText_B4 = "D4";
  51. struct Gadget *Gad_r1;
  52. char *StatAry_r1[] = { "a", "b", "c", "d", (void *)0 };
  53. char **Ary_r1 = StatAry_r1;
  54. long SelNo_r1 = 2;
  55. struct Gadget *Gad_S1;
  56. extern struct MinList List_S1;
  57. long SelNo_S1 = 2;
  58. struct Node NodeAry_S1[10] = {
  59.     { NodeAry_S1 + 1, (struct Node *)&List_S1.mlh_Head, 0, 0, "a" },
  60.     { NodeAry_S1 + 2, NodeAry_S1 + 0, 0, 0, "b" },
  61.     { NodeAry_S1 + 3, NodeAry_S1 + 1, 0, 0, "c" },
  62.     { NodeAry_S1 + 4, NodeAry_S1 + 2, 0, 0, "d" },
  63.     { NodeAry_S1 + 5, NodeAry_S1 + 3, 0, 0, "e" },
  64.     { NodeAry_S1 + 6, NodeAry_S1 + 4, 0, 0, "f" },
  65.     { NodeAry_S1 + 7, NodeAry_S1 + 5, 0, 0, "g" },
  66.     { NodeAry_S1 + 8, NodeAry_S1 + 6, 0, 0, "h" },
  67.     { NodeAry_S1 + 9, NodeAry_S1 + 7, 0, 0, "i" },
  68.     { (struct Node *)&List_S1.mlh_Tail, NodeAry_S1 + 8, 0, 0, "j" }
  69. };
  70.  
  71. struct MinList List_S1 = { &NodeAry_S1[0], (void *)0L, &NodeAry_S1[9] };
  72. struct Gadget *Gad_B1;
  73. struct Gadget *Gad_B2;
  74.  
  75.  
  76. struct Gadget *GList;
  77. struct VisualInfo *VisInfo;
  78.  
  79.  
  80.  
  81. struct Gadget *
  82. InitGads(scr)
  83. struct Screen *scr;
  84. {
  85.     struct Gadget *gad;
  86.     short i;
  87.  
  88.     GList = (void *)0;
  89.     if ((VisInfo = GetVisualInfo(scr, TAG_END)) == NULL)
  90.     return((void *)0L);
  91.  
  92.     {
  93.     struct NewGadget *ng;
  94.     for (i = 0, ng = NGAry; i < sizeof(NGAry)/sizeof(NGAry[0]); ++i, ++ng) {
  95.         ng->ng_VisualInfo = VisInfo;
  96.         ng->ng_TextAttr = scr->Font;
  97.     }
  98.     }
  99.     if ((gad = CreateContext(&GList)) == NULL)
  100.     return((void *)0L);
  101.     Gad_B3 = gad = CreateGadget(STRING_KIND, gad, NGAry + 0,
  102.     GTST_MaxChars, 16,
  103.     GTST_String, DefText_B3,
  104.     TAG_END
  105.     );
  106.     if (gad == NULL)
  107.     return(NULL);
  108.     Buf_B3 = ((struct StringInfo *)gad->SpecialInfo)->Buffer;
  109.  
  110.     Gad_B4 = gad = CreateGadget(STRING_KIND, gad, NGAry + 1,
  111.     GTST_MaxChars, 8,
  112.     GTST_String, DefText_B4,
  113.     TAG_END
  114.     );
  115.     if (gad == NULL)
  116.     return(NULL);
  117.     Buf_B4 = ((struct StringInfo *)gad->SpecialInfo)->Buffer;
  118.  
  119.     Gad_r1 = gad = CreateGadget(CYCLE_KIND, gad, NGAry + 2,
  120.     GTCY_Labels, Ary_r1,
  121.     GTCY_Active, SelNo_r1,
  122.     TAG_END
  123.     );
  124.     if (gad == NULL)
  125.     return(NULL);
  126.  
  127.     Gad_S1 = gad = CreateGadget(LISTVIEW_KIND, gad, NGAry + 3,
  128.     GTLV_Labels, &List_S1,
  129.     GTLV_Selected, SelNo_S1,
  130.     TAG_END
  131.     );
  132.     if (gad == NULL)
  133.     return(NULL);
  134.  
  135.     Gad_B1 = gad = CreateGadget(BUTTON_KIND, gad, NGAry + 4,
  136.     TAG_END
  137.     );
  138.     if (gad == NULL)
  139.     return(NULL);
  140.  
  141.     Gad_B2 = gad = CreateGadget(BUTTON_KIND, gad, NGAry + 5,
  142.     TAG_END
  143.     );
  144.     if (gad == NULL)
  145.     return(NULL);
  146.  
  147.     return(GList);
  148. }
  149.  
  150.  
  151.  
  152. void
  153. FreeGads(void)
  154. {
  155.     FreeGadgets(GList);
  156.     if (VisInfo)
  157.         FreeVisualInfo(VisInfo);
  158.     VisInfo = NULL;
  159.     GList = NULL;
  160. }
  161.